<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title></title>
    <meta name="keywords" content="">
    <meta name="description" content="">

    <link rel="shortcut icon" href="favicon.ico">
    <link href="/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="/css/font-awesome.css?v=4.4.0" rel="stylesheet">

    <link href="/css/animate.css" rel="stylesheet">
    <link href="/css/style.css?v=4.1.0" rel="stylesheet">
</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>行为管理<small></small></h5>
                </div>
                <div class="ibox-content">


                    <table class="table table-striped table-bordered table-hover">
                        <thead>
                        <tr>
                            <th>ID</th>
                            <th>名称</th>
                        </tr>
                        </thead>
                        <tbody>

                        <tr class="gradeA">
                            <td>1</td>
                            <td>注册</td>
                        </tr>


                        </tbody>
                        <tfoot>
                            <tr>
                            <tr>
                                <th>ID</th>
                                <th>名称</th>
                            </tr>
                            </tr>
                        </tfoot>
                    </table>
                    {{--分页--}}
                    <div>
                        <div class="pull-right">
                            {{--{{ $users->appends(['pageSize'=>$pageSize,'searchVal'=>$searchVal])->render()  }}--}}
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

</div>

<!-- 全局js -->
<script src="/js/jquery.min.js?v=2.1.4"></script>
<script src="/js/bootstrap.min.js?v=3.3.6"></script>

<script src="/js/plugins/layer/layer.min.js"></script>


<!-- Page-Level Scripts -->
<script>
    $(document).ready(function () {

        $('.delete-product').click(function () {
            var docuElem=$(this);
            var uid=docuElem.data('value');
            var title=docuElem.data('title');
            if(window.confirm('你确定删除'+ title+'？')){
                //继续执行
                $.ajaxSetup({
                    headers: { 'X-CSRF-TOKEN' : '{{ csrf_token() }}' }
                });
                $.ajax({
                    type:'post',
                    url:'/admin/user/delete',
                    dataType:'json',
                    data:{uid:uid},
                    success: function(data){
                        data= eval(data);
                        if(data.code==200){
                            layer.msg(data.message, {icon: 6});
                            docuElem.parents('.gradeA').remove();
                        }
                        else{
                            layer.msg(data.message, {icon: 5});
                        }
                    }
                });


            }
        });

        $('.reset-passwd').click(function () {
            var docuElem=$(this);
            var uid=docuElem.data('value');
            var title=docuElem.data('title');
            if(window.confirm('确定为'+ title+'重置密码123456？')){
                //继续执行
                $.ajaxSetup({
                    headers: { 'X-CSRF-TOKEN' : '{{ csrf_token() }}' }
                });
                $.ajax({
                    type:'post',
                    url:'/admin/user/resetPasswd',
                    dataType:'json',
                    data:{uid:uid},
                    success: function(data){
                        if(data.code==200){
                            layer.msg(data.message, {icon: 6});
                        }
                        else{
                            layer.msg(data.message, {icon: 5});
                        }
                    }
                });


            }
        });
        //====
        $("select[name='pageSize']").change(function () {
            $('form').submit();
        });


    });

</script>

</body>

</html>
